// Copyright 2022 jeff.li. and/or its affiliates.

#pragma once

#include <initializer_list>

#include <tbir/runtime/container/string_view.h>
#include <tbir/runtime/container/user_data_ref.h>
#include <tbir/runtime/py_args.h>
#include <tbir/runtime/runtime_value.h>

namespace tbir::runtime {

    TURBO_EXPORT UserDataRef make_native_function(string_view func_name);

    TURBO_EXPORT RTValue call_native_function(string_view func_name, PyArgs args);

    template<typename... ARGS>
    inline RTValue call_native_function(string_view func_name, ARGS &&... args) {
        std::initializer_list<RTView> args_init{std::forward<ARGS>(args)...};
        return call_native_function(func_name, PyArgs(args_init));
    }

}  // namespace tbir::runtime